import * as React from "react";
import * as ReactDOM from "react-dom";

import "./AgentList.less";
import NavBar from "../Components/NavBar/NavBar";
import {AgentModel} from "../../model/AgentModel";
import AgentBlock from "../Components/AgentBlock/AgentBlock";


export interface AgentListProps {

}

export interface State {
    AgentList: AgentModel[]
}

export default class AgentList extends React.Component<AgentListProps, State> {
    //默认属性
    static readonly defaultProps: AgentListProps = {};

    constructor(props: AgentListProps) {
        super(props);
        //默认状态
        this.state = {
            AgentList: [
                {
                    id: 'ss',
                    title: '植物精油',
                    number: 'ADC22',
                    level: '城市合伙人',
                    status: '正常',
                }
            ]
        };
    }

    //组件挂载后回调
    componentDidMount() {
        document.title = "经销商后台";

    }

    render() {
        return <div className="AgentList">
            <NavBar title={'代理授权'}/>

            <div className="agent-list">
                {this.state.AgentList.map((it) => {
                    return <AgentBlock item={it} type={'list'}/>
                })}
            </div>

        </div>
    }
}
